/**
 * 
 */
package face.unisannio;

/**
 * @author Fabio Melillo
 *
 */

import android.app.Activity; 
import android.content.Context; 
import android.graphics.Canvas; 
import android.graphics.Color; 
import android.graphics.Paint; 
import android.graphics.RectF;
import android.hardware.Camera; 
import android.os.Bundle; 
import android.view.SurfaceHolder; 
import android.view.SurfaceView; 
import android.view.View; 
import android.view.Window; 
import android.view.ViewGroup.LayoutParams; 

public class TestCameraOverlay extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 


        requestWindowFeature(Window.FEATURE_NO_TITLE); 

        Preview mPreview = new Preview(this); 
        DrawOnTop mDraw = new DrawOnTop(this); 

        setContentView(mPreview); 
        addContentView(mDraw, new LayoutParams 
(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); 

    } 
} 

class DrawOnTop extends View { 

        public DrawOnTop(Context context) { 
                super(context); 
                // TODO Auto-generated constructor stub 
        } 

        @Override 
        protected void onDraw(Canvas canvas) { 
                // TODO Auto-generated method stub 

                Paint paint = new Paint(); 
//                paint.setAlpha(20);
                paint.setStyle(Paint.Style.FILL); 
                paint.setColor(Color.RED);
//                canvas.drawText("Test Text", 10, 10, paint);
                RectF r=new RectF(20, 20, 100, 200);
//                canvas.drawRect(r, paint);
                canvas.drawRoundRect(r, 20, 20, paint);
                
                super.onDraw(canvas); 
        } 

} 
